package Eyjafjalla.card.skill;

import Eyjafjalla.action.MarkHeartAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class Marshmallow_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "Marshmallow_Eyjafjalla";
    private static final CardStrings cardStrings;

    public Marshmallow_Eyjafjalla(){
        super(ID, cardStrings.NAME,0,cardStrings.DESCRIPTION,CardType.SKILL,CardColor.COLORLESS,CardRarity.SPECIAL,CardTarget.NONE);
        this.exhaust = true;
        this.baseBlock = 3;
        this.block = 3;
        this.baseMagicNumber = 3;
        this.magicNumber = 3;
        this.tags.add(EyjafjallaTag.HEART_EYJAFJALLA);
    }

    @Override
    public AbstractCard makeCopy() {
        return new Marshmallow_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new GainBlockAction(p,this.block));
        if(isInAutoplay){
            addToBot(new GainBlockAction(p,this.magicNumber));
        }
    }

    @Override
    protected void applyPowersToBlock() {
        int trueBlock = this.baseBlock;
        baseBlock = this.baseMagicNumber;
        super.applyPowersToBlock();
        this.magicNumber = block;
        isMagicNumberModified = magicNumber!=baseMagicNumber;
        baseBlock = trueBlock;

        super.applyPowersToBlock();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBlock(1);
            upgradeMagicNumber(1);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}





